"use strict";
function getData(data, status) {
    return data;
}
getData('hello', true);
getData(123);
//查找数组内的最小值 [2,3,4] ['a','b','c']
function getMin(arr) {
    var min = arr[0];
    for (var i = 0; i < arr.length; i++) {
        if (min > arr[i]) {
            min = arr[i];
        }
    }
    return min;
}
console.log(getMin([2, 3, 4]));
console.log(getMin(['a', 'b', 'c']));
//根据参数创建长度length，元素为val的数组
function createArray(length, val) {
    var arr = new Array();
    for (var i = 0; i < length; i++) {
        arr.push(val);
    }
    return arr;
}
console.log(createArray(3, 'a')); //['a','a','a']
//数组交换两个值
function swp(tuple) {
    return [tuple[1], tuple[0]];
}
swp([1, 'a']);
//泛型类
var MinCls = /** @class */ (function () {
    function MinCls() {
        this.list = [];
    }
    MinCls.prototype.add = function (num) {
        this.list.push(num);
    };
    MinCls.prototype.getMin = function () {
        var min = this.list[0];
        for (var i = 0; i < this.list.length; i++) {
            if (min > this.list[i]) {
                min = this.list[i];
            }
        }
        return min;
    };
    return MinCls;
}());
var min = new MinCls();
min.add('a');
min.add('c');
console.log(min.getMin());
